//保存一些Echart的通用配置
const options = {
    //基本配置
    baseOption: {
        legend: {},
        xAxis: [],
        yAxis: []
    },
    //二级页面通用配置 字体大小.8rem
    secPageOption: {
        title: {
            textStyle: {
                color: '#fff'
            }
        },
        legend: {
            right: 20,
            textStyle: {
                fontSize: ".8rem",
                color: '#fff'
            }
        },
        tooltip: {},
        calculable: true,
        xAxis: [
            {
                type: 'category',
                nameTextStyle: {
                    fontSize: ".8rem"
                },
                axisLabel: {
                    textStyle: {
                        fontSize: ".8rem",
                    }
                },
                axisLine: {
                    lineStyle: {
                        color: "#fff",
                    }
                }
            }
        ],
        yAxis: [
            {
                type: 'value',
                nameTextStyle: {
                    fontSize: ".8rem"
                },
                axisLabel: {
                    textStyle: {
                        fontSize: ".8rem",
                    }
                },
                axisLine: {
                    lineStyle: {
                        color: "#fff",
                    }
                }
            }
        ],
        grid: {
            top: 50,
            left: 70,
            right: 70,
            bottom: 40
        }
    },
    //电度二级页面通用配置
    elecPageOption: {
        yAxis: [{ name: "电度(kW·h)" }],
        series: [{ name: "电度" }]
    },
    //模态对话框配置
    modelOption: {
        legend: {
            right: 20,
            textStyle: {
                fontSize: ".8rem"
            }
        },
        tooltip: {
            trigger: 'axis'
        },
        calculable: true,
        xAxis: [
            {
                type: 'category',
                nameTextStyle: {
                    fontSize: ".8rem"
                },
                axisLabel: {
                    textStyle: {
                        fontSize: ".8rem",
                    }
                }
            }
        ],
        yAxis: [
            {
                type: 'value',
                nameTextStyle: {
                    fontSize: ".8rem"
                },
                axisLabel: {
                    textStyle: {
                        fontSize: ".8rem",
                    }
                }
            }
        ],
        grid: {
            top: 50,
            left: 50,
            right: 70,
            bottom: 30
        }
    },
    //故障通用配置
    faultPageOption: {
        tooltip: {
            trigger: 'item',
            formatter: '{a} <br/>{b} : {c}次 ({d}%)'
        },
        legend: {
            type: 'scroll',
            bottom: 20,
            textStyle: {
                color: '#fff',  // 图例文字颜色
                fontSize: 14,
            }
        },
        series: [
            {
                name: '故障名称',
                type: 'pie',
                radius: '55%',
                center: ['50%', '40%'],
                emphasis: {
                    itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                },
                itemStyle: {
                    normal: {
                        label: {
                            textStyle: {
                                color: '#fff',
                                fontSize: 14,
                                // fontWeight: 'bolder'
                            }
                        },
                        // labelLine: {
                        //     lineStyle: {
                        //         color: 'black'
                        //     }
                        // }
                    }
                }
            }
        ]
    },
    //故障玫瑰图配置
    faultRoseOption: {
        tooltip: {
            trigger: 'item',
            formatter: '{a} <br/>{b} : {c}次 ({d}%)'
        },
        legend: {
            type: 'scroll',
            bottom: 20,
        },
        series: [
            {
                name: '故障名称',
                type: 'pie',
                radius: '55%',
                center: ['50%', '40%'],
                roseType: 'area',
                itemStyle: {
                    borderRadius: 8
                }
            }
        ]
    },
    //故障模态框配置
    faultModelOption: {
        tooltip: {
            trigger: 'item',
            formatter: '{a} <br/>{b} : {c}次 ({d}%)'
        },
        legend: {
            type: 'scroll',
            orient: 'vertical',
            right: 'right'
        },
        series: [
            {
                name: '故障名称',
                type: 'pie',
                radius: '55%',
                center: ['40%', '40%'],
                emphasis: {
                    itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    }
}

module.exports.options = options;
